package net.simflow.swf.analyzer.exec.data;

import net.simflow.swf.analyzer.network.data.Flow;

public class TaskExecResult {
	private int id;
	private Flow flow;
	private int startTime = -1;
	private int endTime = -1;
	private int deadline = -1;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Flow getFlow() {
		return flow;
	}

	public void setFlow(Flow flow) {
		this.flow = flow;
	}

	public int getStartTime() {
		return startTime;
	}

	public void setStartTime(int startTime) {
		this.startTime = startTime;
	}

	public int getEndTime() {
		return endTime;
	}

	public void setEndTime(int endTime) {
		this.endTime = endTime;
	}

	public int getDeadline() {
		return deadline;
	}

	public void setDeadline(int deadline) {
		this.deadline = deadline;
	}

	public int getExecTime() {
		if (this.endTime == -1) {
			return -1;
		} else {
			return this.endTime - this.startTime;
		}
	}

	public String getInfo() {
		return this.getId() + ": " + this.getFlow().getNameInNetwork() + ": "
				+ this.getStartTime() + ": " + this.getDeadline() + ": "
				+ this.getEndTime() + ": " + this.getExecTime();
	}

	@Override
	public String toString() {
		return getInfo();
	}
}
